﻿<%@ Page MasterPageFile="~/Site1.Master" Language="C#" AutoEventWireup="true" CodeBehind="Dislocation.aspx.cs" Inherits="DigDes.DSchool.SUPS.Web.UI.Dislocation"  %>


    <asp:Content ContentPlaceHolderID="web1" runat="server">
  
        <br/><br/>
       <asp:GridView ID="GridView1" runat="server" AllowPaging="True" Width="640px"
           AllowSorting="True" AutoGenerateColumns="false" DataSourceID="SqlDataSource" 
           EmptyDataText="NULL" CssClass="grid_dis"
           >
            <Columns>
               <asp:BoundField DataField="InventoryCarriageNumber" HeaderText="Инв. номер вагона" SortExpression="InventoryCarriageNumber" />
                <asp:BoundField DataField="WeightTons" HeaderText="Вес груза в тоннах" SortExpression="WeightTons" />
                <asp:BoundField DataField="DestinationStation" HeaderText="Станция назначения вагона" SortExpression="DestinationStation" />
                <asp:BoundField DataField="CargoCodeTariff" HeaderText="Код груза по тарифн. номенклатуре" SortExpression="CargoCodeTariff" />
                <asp:BoundField DataField="ConsigneeCode" HeaderText="Код грузополучателя" SortExpression="ConsigneeCode" />
                <asp:BoundField DataField="ParkType" HeaderText="Тип парка вагона" SortExpression="ParkType" />
                <asp:BoundField DataField="StartStation" HeaderText="Станция начала рейса" SortExpression="StartStation" />
 
                <asp:BoundField DataField="OperationDate" HeaderText="Дата операции" SortExpression="OperationDate" /> 
                <asp:BoundField DataField="OperationTime" HeaderText="Время операции" SortExpression="OperationTime" />
                <asp:BoundField DataField="StationOfOperation" HeaderText="Станция сверш. операции" SortExpression="StationOfOperation" />
                <asp:BoundField DataField="DeliveryRoad" HeaderText="Дорога сдачи	" SortExpression="DeliveryRoad" />
                <asp:BoundField DataField="ReceiptRoad" HeaderText="Дорога приема" SortExpression="ReceiptRoad" />
                <asp:BoundField DataField="TrainIndex" HeaderText="Индекс поезда" SortExpression="TrainIndex" />
                <asp:BoundField DataField="TrainNumber" HeaderText="Номер поезда" SortExpression="TrainNumber" />
            </Columns>       
        </asp:GridView>


      <asp:SqlDataSource ID="SqlDataSource" runat="server" ConnectionString="Data Source=.\SQLEXPRESS;Initial Catalog=SUPS;Integrated Security=True;"  ProviderName="System.Data.SqlClient" 
         SelectCommand="
		   SELECT   tbDislocation.InventoryCarriageNumber, tbDislocation.WeightTons, DestStation.Name as DestinationStation, tbDislocation.CargoCodeTariff, tbDislocation.ConsigneeCode,
                    tbDislocation.ParkType, StartStation.Name as StartStation , SUBSTRING(tbDislocation.OperationDate,1,2)+'.'+SUBSTRING(tbDislocation.OperationDate,3,2)+'.'+tbDislocation.OperationYear as OperationDate,
                    SUBSTRING(tbDislocation.OperationTime,1,2)+':'+SUBSTRING(tbDislocation.OperationTime,3,2) as OperationTime, OpStation.Name as StationOfOperation,
                    DelRoad.Name as DeliveryRoad,RecRoad.Name as ReceiptRoad,tbDislocation.TrainIndex,tbDislocation.TrainNumber
                 
          FROM      tbDislocation,Station as DestStation, Station as StartStation, Station as OpStation, Road as DelRoad, Road as RecRoad

          WHERE     tbDislocation.DestinationStation=DestStation.Code and
                    tbDislocation.StartStation = StartStation.Code and
                    tbDislocation.StationOfOperation = OpStation.Code and
                    tbDislocation.DeliveryRoad = DelRoad.Code and
	                tbDislocation.ReceiptRoad = RecRoad.Code
          
          "></asp:SqlDataSource>


        <br />

        <h1>Пара-парам</h1>

         <asp:GridView ID="GridView2" runat="server" AllowPaging="True" Width="640px"
           AllowSorting="True" AutoGenerateColumns="true" DataSourceID="ObjDataSource"
             EmptyDataText="NULL" CssClass="grid_dis">
            <Columns>
           
        </Columns>
                 
        </asp:GridView>


             <asp:ObjectDataSource ID="ObjDataSource" runat="server" 
                 typename="DigDes.DSchool.SUPS.DataAccess.Database.ObjectDataSource" 
                 SelectMethod="SelectAllDislocation"></asp:ObjectDataSource>
            
</asp:Content>